package Test11.topic;

import com.sun.scenario.effect.impl.sw.java.JSWColorAdjustPeer;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;

import java.util.Arrays;
import java.util.Random;
import java.util.Scanner;

/**数组的三种格式*/
public class topic1 {
    public static void main(String[] args) {
        shuzu();
        shuzu1();
        shuzu2();
        
    }
//练习冒泡排序
    private static void shuzu2() {
        int[]a = new int[]{23,6543,88,234,66,554,9967};
        for (int i = 0; i <a.length ; i++) {
            for (int j = 0; j <a.length-1 ; j++) {
                if (a[j]>a[j+1]){
                    a[j] =a[j]^a[j+1];
                    a[j+1] =a[j]^a[j+1];
                    a[j] = a[j]^a[j+1];
                }
            }
        }
        System.out.println(Arrays.toString(a));
    }

    private static void shuzu1() {
        int[]a =new int[6];
        for (int i = 0; i < a.length ; i++) {
            a[i] = new Random().nextInt(100);
        }
        System.out.println(Arrays.toString(a));

    }

    private static void shuzu() {
        int[]a ={1,2,3,4,5,6};
        for (int i= 0;i<= a.length-1;i++){
            System.out.println(a[i]);
        }
    }
}
